<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<h:body>

	<ui:composition template="WEB-INF/templates/common/common-layout.xhtml">

		<ui:define name="content">
			<h:form>
				<p:panel header="New Student Registration Form"
					footer="designed by vijaya" style="width:600px;">

					<p:panelGrid columns="3" style="">

						<p:outputLabel value="First Name" for="firstNameTxt" />
						<p:inputText id="firstNameTxt" maxlength="150" 
							validatorMessage="First Name is required">
							<f:validateLength minimum="2" maximum="150" />
						</p:inputText>
						<p:message for="firstNameTxt" />

						<p:outputLabel value="Middle Name" for="middleNameTxt" />
						<p:inputText id="middleNameTxt" maxlength="150">
							<f:validateLength minimum="0" maximum="150" />
						</p:inputText>
						<p:message for="middleNameTxt" />

						<p:outputLabel value="Last Name" for="lastNameTxt" />
						<p:inputText id="lastNameTxt" maxlength="150">
							<f:validateLength minimum="0" maximum="150" />
						</p:inputText>
						<p:message for="lastNameTxt" />

						<p:outputLabel value="Gender:" for="gender" />
						<p:selectOneRadio id="gender" required="true"
							requiredMessage="Select Gender">
							<f:selectItem itemLabel="Male" itemValue="F" />
							<f:selectItem itemLabel="Female" itemValue="M" />
						</p:selectOneRadio>
						<p:message for="gender" />

						<p:outputLabel value="Date of Birth" for="dob" />
						<p:calendar id="dob" yearRange="1950" pattern="dd-MM-yyyy"
							navigator="true" required="true"
							requiredMessage="Date of Birth is required" />
						<p:message for="dob" />


						<p:spacer width="10" height="10" />
						<p:commandButton value="Save" ajax="false"
							actionListener="#{gradesBean.submitGradesForm()}" />
					</p:panelGrid>
				</p:panel>
			</h:form>
			<h:form>
				<p:dataTable value="#{gradesBean.grades}" var="g">
					<p:column headerText="Grade Id">
						<p:outputLabel value="#{g.gradeId}" />
					</p:column>
					<p:column headerText="Grade Name">
						<p:outputLabel value="#{g.gradeName}" />
					</p:column>
				</p:dataTable>
			</h:form>

		</ui:define>

	</ui:composition>

</h:body>

</html>